<div class="list-div" id="listDiv">
<table width="100%" cellspacing="1" cellpadding="2" id="list-table">
  <tr>  	
    <th>名称</th>
    <th>类型</th>
    <th>数据表</th>
    <th>启用全站搜索</th>
    <th>描述</th>  
    <th>管理操作</th>
  </tr>  
  <!--{loop $result $k $v}-->
  <tr align="center">    
    <td>$v['name']</td>
    <td><!--{if ($v['modeltype']==0)}-->直播<!--{elseif ($v['modeltype']==1)}-->点播<!--{elseif ($v['modeltype']==2)}-->专题<!--{else}-->文本<!--{/if}--></td>
     <td>$v['tablename']</td>
    <td><!--{if ($v['enablesearch']==0)}-->不启用<!--{else}-->启用<!--{/if}--></td>
    <td>$v['description']</td>
    <td align="center">
      <a href="/model/fieldindex/tablename/$v['tablename']">字段管理</a> |
      <a href="/model/edit/modelid/$v['modelid']">修改</a> |
      <!--{if ($v['issystem']==0)}--><a class="disable" id="dis$v['modelid']" href="void(0);" title="禁用">禁用</a><a class="able" id="a$v['modelid']" href="void(0);" title="启用"><font color=#FF0000>启用</font></a><!--{else}--><!--{/if}--> |      
      <!--{if ($v['issystem']==1)}--><font color="#CCCCCC">删除</font><!--{else}--><a class="confirm" id="d$v['modelid']" href="void(0);">删除</a><!--{/if}-->
    </td>
  </tr>
  <!--{/loop}-->
</table>
<script type="text/javascript" language="javascript"> 
    $('.confirm').click(function() {  
    	function deltr(result){
            var o_this = $(this);
            if (result!='')
            {
                $('#'+result).parent().parent().remove();
            }
        }      
        var del_id = $(this).attr('id');
        del_id = del_id.substr(1);
    	$.ajax({
            url: "/model/saveajax/type/delete/modelid/"+del_id+"/",
            cache: false, success: deltr
        });
	    return false;
	});
	$('.confirm').confirm({
		msg:'你确认吗？', timeout:3000, buttons: { ok:'确定', cancel:'取消' }
	});
	//
	$('.disable').click(function() {    
		function deltr(result){
            var o_this = $(this);
        }    
        var del_id = $(this).attr('id');
        del_id = del_id.substr(3);
    	$.ajax({
            url: "/model/saveajax/type/disable/modelid/"+del_id+"/",
            cache: false, success: deltr
        });
	    return false;
	});
	$('.disable').confirm({
		msg:'你确认吗？', timeout:3000, buttons: { ok:'确定', cancel:'取消' }
	});
	//
	$('.able').click(function() {    
		function deltr(result){
            var o_this = $(this);
        }         
        var del_id = $(this).attr('id');
        del_id = del_id.substr(1);
    	$.ajax({
            url: "/model/saveajax/type/able/modelid/"+del_id+"/",
            cache: false, success: deltr
        });
	    return false;
	});
	$('.able').confirm({
		msg:'你确认吗？', timeout:3000, buttons: { ok:'确定', cancel:'取消' }
	});
</script>
<!--      
    <tr>
      <td align="right" nowrap="true" colspan="6">
            <div id="turn-page">
        总计  <span id="totalRecords">9</span>
        个记录分为 <span id="totalPages">1</span>
        页当前第 <span id="pageCurrent">1</span>
        页，每页 <input type='text' size='3' id='pageSize' value="15" onkeypress="return listTable.changePageSize(event)" />
        <span id="page-link">
          <a href="javascript:listTable.gotoPageFirst()">第一页</a>
          <a href="javascript:listTable.gotoPagePrev()">上一页</a>
          <a href="javascript:listTable.gotoPageNext()">下一页</a>
          <a href="javascript:listTable.gotoPageLast()">最末页</a>
          <select id="gotoPage" onchange="listTable.gotoPage(this.value)">
            <option value='1'>1</option>          </select>
        </span>
      </div>
      </td>
    </tr>
-->
</div>
